<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <!-- 插槽使用的作用域是父组件的作用域 -->
      <!-- 哪个组件的template里面使用的就是那个组件的作用域 -->
      <h3>插槽作用域</h3>
      <child>{{ count }}</child>
    </div>

    <script src="../Vue.js"></script>
    <script>
      const Child = {
        template: `
          <div>child组件 - <slot></slot></div>
        `,
      };
      new Vue({
        el: "#app",
        data() {
          return {
            count: 10,
          };
        },
        components: {
          Child,
        },
      });
    </script>
  </body>
</html>
